package com.ovidiojf.timeTable;

import java.awt.Color;

public class Professor {


	public Professor(String name, Color color) {
		super();
		this.name = name;
		this.color = color;
		
		resetDaysRestrictions();		
	}
	
	public void setClassesOfScholl(String[] classes) {
		this.classes = new int[classes.length];		
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public Color getColor() {
		return color;
	}
	
	public void setColor(Color color) {
		this.color = color;
	}

	public void setDayRestriction(int day, boolean restricted) {
		daysRestrictions[day] = restricted;
	}
	
	public boolean isDayRestriction(int day) {
		return daysRestrictions[day];
	}
	
	public void resetDaysRestrictions() {
		for (int i=0; i<daysRestrictions.length; i++)
			daysRestrictions[i] = false;
	}
	
	public void setClassToTeach(int classIndex, int classesPerWeek) {
		classes[classIndex] = classesPerWeek;
	}
	
	public boolean isClassToTeach(int classIndex) {
		return classes[classIndex] > 0;
	}
	
	public int classesInClassRom(int classRomIndex) {
		return classes[classRomIndex];
	}
	
	public void resetClassToTeach() {
		for (int i=0; i<classes.length; i++)
			classes[i] = 0;
	}
	
	public int [] getClasses() {
		return classes;
	}


	private String name;
	private Color  color;
	private boolean[] daysRestrictions = new boolean[7];
	private int[] classes;
}
